home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld Secrets (4th Edition)
/
Mac Secrets CD 4th Ed.toast
/
Shareware & Freeware
/
KeyQuencer 1.2.2
/
Developer’s toolkit
/
Common code
/
KQPPCGlue.h
< prev
Wrap
Text File
|
1995-12-16
|
12KB
|
271 lines
// =============================================================================
// KEYQUENCER GLUE ROUTINE DESCRIPTORS FOR PPC - VERSION 1.2.2 - DECEMBER 1995
// By Alessandro Levi Montalcini <alm@torino.alpcom.it>
// ©1994-96 Binary Software, Inc. <binarysoft@eworld.com>
// This text looks best in monaco 9 font, 4 spaces per tab, no wrapping
//==============================================================================
// This file contains the procInfos and macros needed to call some of the KQ
// glue routines from PowerPC code. You may build your own procInfos if you need
// to call a glue routine that's not listed here.
//==============================================================================
#pragma once
#ifndef _H_kqppcglue
#define _H_kqppcglue
//==============================================================================
enum {
uppKQStopSequenceProcInfo = kPascalStackBased,
uppKQExecuteScriptProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(short)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))),
uppKQMacroRunningProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Boolean))),
uppKQAppleEventsBusyProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Boolean))),
uppKQCountMacrosProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(short))),
uppKQBuildSortedIndexProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Ptr))),
uppKQGetMacroInfoProcInfo = kPascalStackBased
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned char*)))
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short*)))
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short*))),
uppKQGetIndexedMacroProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Handle)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))),
uppKQGetNamedMacroProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Handle)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ConstStr31Param))),
uppKQLastMacroErrorProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(short))),
uppKQGetVariableProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(long)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ConstStr255Param)))
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(StringPtr))),
uppKQSetVariableProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(long)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ConstStr255Param)))
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ConstStr255Param))),
uppKQClearVariableProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(long)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ConstStr255Param))),
uppKQCountVariablesProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(long))),
uppKQGetIndexedVariableProcInfo = kPascalStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(long)))
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(StringPtr)))
};
//==============================================================================
#if GENERATINGCFM // PowerPC or 68K Code Fragment Mgr
typedef UniversalProcPtr KQStopSequenceUPP;
#define CallKQStopSequenceProc(userRoutine) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQStopSequenceProcInfo)
#define NewKQStopSequenceProc(userRoutine) \
(KQStopSequenceUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQStopSequenceProcInfo, kM68kISA)
typedef UniversalProcPtr KQExecuteScriptUPP;
#define CallKQExecuteScriptProc(userRoutine, macro) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQExecuteScriptProcInfo, (macro))
#define NewKQExecuteScriptProc(userRoutine) \
(KQExecuteScriptUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQExecuteScriptProcInfo, kM68kISA)
typedef UniversalProcPtr KQMacroRunningUPP;
#define CallKQMacroRunningProc(userRoutine) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQMacroRunningProcInfo)
#define NewKQMacroRunningProc(userRoutine) \
(KQMacroRunningUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQMacroRunningProcInfo, kM68kISA)
typedef UniversalProcPtr KQAppleEventsBusyUPP;
#define CallKQAppleEventsBusyProc(userRoutine) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQAppleEventsBusyProcInfo)
#define NewKQAppleEventsBusyProc(userRoutine) \
(KQAppleEventsBusyUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQAppleEventsBusyProcInfo, kM68kISA)
typedef UniversalProcPtr KQCountMacrosUPP;
#define CallKQCountMacrosProc(userRoutine) \
(short)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQCountMacrosProcInfo)
#define NewKQCountMacrosProc(userRoutine) \
(KQCountMacrosUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQCountMacrosProcInfo, kM68kISA)
typedef UniversalProcPtr KQBuildSortedIndexUPP;
#define CallKQBuildSortedIndexProc(userRoutine) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQBuildSortedIndexProcInfo)
#define NewKQBuildSortedIndexProc(userRoutine) \
(KQBuildSortedIndexUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQBuildSortedIndexProcInfo, kM68kISA)
typedef UniversalProcPtr KQGetMacroInfoUPP;
#define CallKQGetMacroInfoProc(userRoutine, macroIndex, macroName, keyCode, modifiers) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQGetMacroInfoProcInfo, (macroIndex), (macroName), (keyCode), (modifiers))
#define NewKQGetMacroInfoProc(userRoutine) \
(KQGetMacroInfoUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQGetMacroInfoProcInfo, kM68kISA)
typedef UniversalProcPtr KQGetIndexedMacroUPP;
#define CallKQGetIndexedMacroProc(userRoutine, macroIndex) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQGetIndexedMacroProcInfo, (macroIndex))
#define NewKQGetIndexedMacroProc(userRoutine) \
(KQGetIndexedMacroUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQGetIndexedMacroProcInfo, kM68kISA)
typedef UniversalProcPtr KQGetNamedMacroUPP;
#define CallKQGetNamedMacroProc(userRoutine, macroName) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQGetNamedMacroProcInfo, (macroName))
#define NewKQGetNamedMacroProc(userRoutine) \
(KQGetNamedMacroUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQGetNamedMacroProcInfo, kM68kISA)
typedef UniversalProcPtr KQLastMacroErrorUPP;
#define CallKQLastMacroErrorProc(userRoutine) \
(short)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQLastMacroErrorProcInfo)
#define NewKQLastMacroErrorProc(userRoutine) \
(KQLastMacroErrorUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQLastMacroErrorProcInfo, kM68kISA)
typedef UniversalProcPtr KQGetVariableUPP;
#define CallKQGetVariableProc(userRoutine, variableName, variableValue) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQGetVariableProcInfo, (variableName), (variableValue))
#define NewKQGetVariableProc(userRoutine) \
(KQGetVariableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQGetVariableProcInfo, kM68kISA)
typedef UniversalProcPtr KQSetVariableUPP;
#define CallKQSetVariableProc(userRoutine, variableName, variableValue) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQSetVariableProcInfo, (variableName), (variableValue))
#define NewKQSetVariableProc(userRoutine) \
(KQSetVariableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQSetVariableProcInfo, kM68kISA)
typedef UniversalProcPtr KQClearVariableUPP;
#define CallKQClearVariableProc(userRoutine, variableName) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQClearVariableProcInfo, (variableName))
#define NewKQClearVariableProc(userRoutine) \
(KQClearVariableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQClearVariableProcInfo, kM68kISA)
typedef UniversalProcPtr KQCountVariablesUPP;
#define CallKQCountVariablesProc(userRoutine) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQCountVariablesProcInfo)
#define NewKQCountVariablesProc(userRoutine) \
(KQCountVariablesUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQCountVariablesProcInfo, kM68kISA)
typedef UniversalProcPtr KQGetIndexedVariableUPP;
#define CallKQGetIndexedVariableProc(userRoutine, variableIndex, variableValue) \
(Handle)CallUniversalProc((UniversalProcPtr)(userRoutine), uppKQGetIndexedVariableProcInfo, (variableIndex), (variableValue))
#define NewKQGetIndexedVariableProc(userRoutine) \
(KQGetIndexedVariableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppKQGetIndexedVariableProcInfo, kM68kISA)
#else // 68K, no Code Fragment Mgr
typedef pascal void (*KQStopSequenceUPP)(void);
#define CallKQStopSequenceProc(userRoutine) \
(*(userRoutine))()
#define NewKQStopSequenceProc(userRoutine) \
(KQStopSequenceUPP)(userRoutine)
typedef pascal short (*KQExecuteScriptUPP)(Handle macro);
#define CallKQExecuteScriptProc(userRoutine, macro) \
(*(userRoutine))(macro)
#define NewKQExecuteScriptProc(userRoutine) \
(KQExecuteScriptUPP)(userRoutine)
typedef pascal Boolean (*KQMacroRunningUPP)(void);
#define CallKQMacroRunningProc(userRoutine) \
(*(userRoutine))()
#define NewKQMacroRunningProc(userRoutine) \
(KQMacroRunningUPP)(userRoutine)
typedef pascal Boolean (*KQAppleEventsBusyUPP)(void);
#define CallKQAppleEventsBusyProc(userRoutine) \
(*(userRoutine))()
#define NewKQAppleEventsBusyProc(userRoutine) \
(KQAppleEventsBusyUPP)(userRoutine)
typedef pascal short (*KQCountMacrosUPP)(void);
#define CallKQCountMacrosProc(userRoutine) \
(*(userRoutine))()
#define NewKQCountMacrosProc(userRoutine) \
(KQCountMacrosUPP)(userRoutine)
typedef pascal Ptr (*KQBuildSortedIndexUPP)(void);
#define CallKQBuildSortedIndexProc(userRoutine) \
(*(userRoutine))()
#define NewKQBuildSortedIndexProc(userRoutine) \
(KQBuildSortedIndexUPP)(userRoutine)
typedef pascal void (*KQGetMacroInfoUPP)(short macroIndex, unsigned char *macroName, short *keyCode, short *modifiers);
#define CallKQGetMacroInfoProc(userRoutine, macroIndex, macroName, keyCode, modifiers) \
(*(userRoutine))((macroIndex), (macroName), (keyCode), (modifiers))
#define NewKQGetMacroInfoProc(userRoutine) \
(KQGetMacroInfoUPP)(userRoutine)
typedef pascal Handle (*KQGetIndexedMacroUPP)(short macroIndex);
#define CallKQGetIndexedMacroProc(userRoutine, macroIndex) \
(*(userRoutine))(macroIndex)
#define NewKQGetIndexedMacroProc(userRoutine) \
(KQGetIndexedMacroUPP)(userRoutine)
typedef pascal Handle (*KQGetNamedMacroUPP)(ConstStr31Param macroName);
#define CallKQGetNamedMacroProc(userRoutine, macroName) \
(*(userRoutine))(macroName)
#define NewKQGetNamedMacroProc(userRoutine) \
(KQGetNamedMacroUPP)(userRoutine)
typedef pascal short (*KQLastMacroErrorUPP)(void);
#define CallKQLastMacroErrorProc(userRoutine) \
(*(userRoutine))()
#define NewKQLastMacroErrorProc(userRoutine) \
(KQLastMacroErrorUPP)(userRoutine)
typedef pascal long (*KQGetVariableUPP)(ConstStr255Param variableName, StringPtr variableValue);
#define CallKQGetVariableProc(userRoutine, variableName, variableValue) \
(*(userRoutine))((variableName), (variableValue))
#define NewKQGetVariableProc(userRoutine) \
(KQGetVariableUPP)(userRoutine)
typedef pascal long (*KQSetVariableUPP)(ConstStr255Param variableName, ConstStr255Param variableValue);
#define CallKQSetVariableProc(userRoutine, variableName, variableValue) \
(*(userRoutine))((variableName), (variableValue))
#define NewKQSetVariableProc(userRoutine) \
(KQSetVariableUPP)(userRoutine)
typedef pascal long (*KQClearVariableUPP)(ConstStr255Param variableName);
#define CallKQClearVariableProc(userRoutine, variableName) \
(*(userRoutine))(variableName)
#define NewKQClearVariableProc(userRoutine) \
(KQClearVariableUPP)(userRoutine)
typedef pascal long (*KQCountVariablesUPP)(void);
#define CallKQCountVariablesProc(userRoutine) \
(*(userRoutine))()
#define NewKQCountVariablesProc(userRoutine) \
(KQCountVariablesUPP)(userRoutine)
typedef pascal long (*KQGetIndexedVariableUPP)(long variableIndex, StringPtr variableValue);
#define CallKQGetIndexedVariableProc(userRoutine, variableIndex, variableValue) \
(*(userRoutine))((variableIndex), (variableValue))
#define NewKQGetIndexedVariableProc(userRoutine) \
(KQGetIndexedVariableUPP)(userRoutine)
#endif // GENERATINGCFM
//==============================================================================
#endif // _H_kqppcglue
//==============================================================================